﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace ApiDoc.CodeSyntaxGenerators
{
    public abstract class CodeSyntaxGeneratorBase : ICodeSyntaxGenerator
    {
        public abstract string GenerateName(Type type);

        public abstract string GenerateName(System.Reflection.MethodInfo method);

        public abstract string GenerateName(System.Reflection.PropertyInfo property);

        public abstract string GenerateName(System.Reflection.ConstructorInfo constructor);

        /// <summary>
        /// Generate the name for <paramref name="field"/> in a friendly form for developers.
        /// </summary>
        /// <param name="field"></param>
        /// <returns></returns>
        public abstract string GenerateName(System.Reflection.FieldInfo field);

        public abstract string GenerateName(System.Reflection.EventInfo field);

        public abstract string GenerateName(System.Reflection.ParameterInfo parameter);

        public abstract string GenerateCodeDefinition(Type type);

        public abstract string GenerateCodeDefinition(System.Reflection.MethodInfo method);

        public abstract string GenerateCodeDefinition(System.Reflection.PropertyInfo property);

        public abstract string GenerateCodeDefinition(System.Reflection.ConstructorInfo constructor);

        public abstract string GenerateCodeDefinition(System.Reflection.FieldInfo field);

        public abstract string GenerateCodeDefinition(System.Reflection.EventInfo field);

        public abstract string GenerateCodeDefinition(System.Reflection.ParameterInfo parameter);

        public string GenerateName(TypeDocumentation type)
        {
            return GenerateName(type.Member);
        }

        public string GenerateName(MethodDocumentation method)
        {
            return GenerateName(method.Member);
        }

        public string GenerateName(PropertyDocumentation property)
        {
            return GenerateName(property.Member);
        }

        public string GenerateName(ConstructorDocumentation constructor)
        {
            return GenerateName(constructor.Member);
        }

        /// <summary>
        /// Generate the name for <paramref name="field"/> in a friendly form for developers.
        /// </summary>
        /// <param name="field"></param>
        /// <returns></returns>
        public string GenerateName(FieldDocumentation field)
        {
            return GenerateName(field.Member);
        }

        public string GenerateName(EventDocumentation eventx)
        {
            return GenerateName(eventx.Member);
        }

        public string GenerateCodeDefinition(TypeDocumentation type)
        {
            return GenerateCodeDefinition(type.Member);
        }

        public string GenerateCodeDefinition(MethodDocumentation method)
        {
            return GenerateCodeDefinition(method.Member);
        }

        public string GenerateCodeDefinition(PropertyDocumentation property)
        {
            return GenerateCodeDefinition(property.Member);
        }

        public string GenerateCodeDefinition(ConstructorDocumentation constructor)
        {
            return GenerateCodeDefinition(constructor.Member);
        }

        public string GenerateCodeDefinition(FieldDocumentation field)
        {
            return GenerateCodeDefinition(field.Member);
        }

        public string GenerateCodeDefinition(EventDocumentation eventx)
        {
            return GenerateCodeDefinition(eventx.Member);
        }

        public string GenerateCodeDefinition(ParameterDocumentation parameter)
        {
            return GenerateCodeDefinition(parameter.Member);
        }
    }
}
